<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Folderlist{
    function showfolder($dirs){
        $files1 = @scandir($dirs);
        if($files1!==false)
        {
            foreach($files1 AS $dir){
                if($dir != '.' && $dir != '..')
                {
                    if(is_dir($dirs.DS.$dir)===true)
                    {
                        $dir1[] = $dir;
                    }
                }
            }// End foreach
            return $dir1;
        }
        else
        {
            return false;
        }
    }

    function numfile($dir,$dirlist){
        foreach($dirlist AS $folder){
            $files1 = @scandir($dir.DS.$folder);
            $i=0;
            foreach($files1 AS $f){

                if(is_file($dir.DS.$folder.DS.$f)===true)
                {
                    $i++;
                }
            }
            $number[] = $i;
        }
        return $number;
    }

    function showfiles($dirs){
        $files1 = @scandir($dirs);
        foreach($files1 AS $dir){
            if($dir != '.' && $dir != '..')
            {
                if(is_file($dirs.DS.$dir)===true)
                {
                    $dir1[] = $dir;
                }
            }
        }// End foreach
        return $dir1;
    }
}
?>
